package cn.shyouchi.wuguanjia.android.ui.event.labor;

import android.os.Parcel;
import android.os.Parcelable;

import com.chad.library.adapter.base.entity.AbstractExpandableItem;
import com.chad.library.adapter.base.entity.MultiItemEntity;

import java.util.List;

import cn.shyouchi.wuguanjia.android.ui.event.arrange.PersonRankAdapter;
import cn.shyouchi.wuguanjia.android.ui.event.arrange.RankAdapter;

/**
 * Created by Eenie on 2016/11/21 at 15:38
 * Email: 472279981@qq.com
 * Des:
 */

public class LaborRequestEntity {


    /**
     * resultCode : 0
     * resultMessage : [{"id":1,"date":"2016-11-21","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"12"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"11"}]},{"id":2,"date":"2016-11-22","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"12"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"11"}]},{"id":3,"date":"2016-11-23","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"12"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"11"}]},{"id":4,"date":"2016-11-24","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"12"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"11"},{"service":{"id":5,"servicesname":"去日本按","starttime":"12:54:00","endtime":"16:54:00","time":4},"service_people":"12"},{"service":{"id":6,"servicesname":"去日本按","starttime":"12:54:00","endtime":"16:54:00","time":4},"service_people":"16"}]},{"id":5,"date":"2016-11-25","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"12"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"11"},{"service":{"id":5,"servicesname":"去日本按","starttime":"12:54:00","endtime":"16:54:00","time":4},"service_people":"12"},{"service":{"id":6,"servicesname":"去日本按","starttime":"12:54:00","endtime":"16:54:00","time":4},"service_people":"16"}]},{"id":6,"date":"2016-11-26","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"12"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"11"},{"service":{"id":5,"servicesname":"去日本按","starttime":"12:54:00","endtime":"16:54:00","time":4},"service_people":"12"},{"service":{"id":6,"servicesname":"去日本按","starttime":"12:54:00","endtime":"16:54:00","time":4},"service_people":"16"}]},{"id":7,"date":"2016-11-30","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"12"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"11"},{"service":{"id":5,"servicesname":"去日本按","starttime":"12:54:00","endtime":"16:54:00","time":4},"service_people":"12"},{"service":{"id":6,"servicesname":"去日本按","starttime":"12:54:00","endtime":"16:54:00","time":4},"service_people":"16"}]},{"id":8,"date":"2016-11-29","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"12"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"11"},{"service":{"id":5,"servicesname":"去日本按","starttime":"12:54:00","endtime":"16:54:00","time":4},"service_people":"12"},{"service":{"id":6,"servicesname":"去日本按","starttime":"12:54:00","endtime":"16:54:00","time":4},"service_people":"16"}]},{"id":9,"date":"2016-11-28","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"12"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"11"},{"service":{"id":5,"servicesname":"去日本按","starttime":"12:54:00","endtime":"16:54:00","time":4},"service_people":"12"},{"service":{"id":6,"servicesname":"去日本按","starttime":"12:54:00","endtime":"16:54:00","time":4},"service_people":"16"}]},{"id":10,"date":"2016-11-21","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"0"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"0"}]},{"id":11,"date":"2016-11-22","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"0"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"0"}]},{"id":12,"date":"2016-11-23","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"0"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"0"}]},{"id":13,"date":"2016-11-24","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"0"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"0"}]},{"id":14,"date":"2016-11-21","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"0"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"0"}]},{"id":15,"date":"2016-11-22","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"0"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"0"}]},{"id":16,"date":"2016-11-23","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"0"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"0"}]},{"id":17,"date":"2016-11-24","service":[{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"0"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"0"}]}]
     */

    private int resultCode;
    private List<ResultMessageBean> resultMessage;

    public int getResultCode() {
        return resultCode;
    }

    public void setResultCode(int resultCode) {
        this.resultCode = resultCode;
    }

    public List<ResultMessageBean> getResultMessage() {
        return resultMessage;
    }

    public void setResultMessage(List<ResultMessageBean> resultMessage) {
        this.resultMessage = resultMessage;
    }

    public static class ResultMessageBean {
        /**
         * id : 1
         * date : 2016-11-21
         * service : [{"service":{"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1},"service_people":"12"},{"service":{"id":4,"servicesname":"晚班","starttime":"09:58:00","endtime":"13:58:00","time":4},"service_people":"11"}]
         */

        private int id;
        private String date;
        private List<ServiceBeanX> service;


        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getDate() {
            return date;
        }

        public void setDate(String date) {
            this.date = date;
        }

        public List<ServiceBeanX> getService() {
            return service;
        }

        public void setService(List<ServiceBeanX> service) {
            this.service = service;
        }

        public static class ServiceBeanX extends AbstractExpandableItem<PersonRankAdapter.Person> implements MultiItemEntity, Parcelable {

            /**
             * service : {"id":2,"servicesname":"日班","starttime":"09:50:00","endtime":"14:53:00","time":5.1}
             * service_people : 12
             */

            private RankTime.ResultMessageBean service;
            private int service_people;


            public RankTime.ResultMessageBean getService() {
                return service;
            }

            public void setService(RankTime.ResultMessageBean service) {
                this.service = service;
            }

            public int getService_people() {
                return service_people;
            }

            public void setService_people(int service_people) {
                this.service_people = service_people;
            }



            @Override
            public int getItemType() {
                return RankAdapter.RANK_TYPE_ITEM;
            }

            @Override
            public int getLevel() {
                return 0;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeParcelable(this.service, flags);
                dest.writeInt(this.service_people);
            }

            public ServiceBeanX() {
            }

            protected ServiceBeanX(Parcel in) {
                this.service = in.readParcelable(RankTime.ResultMessageBean.class.getClassLoader());
                this.service_people = in.readInt();
            }

            public static final Parcelable.Creator<ServiceBeanX> CREATOR = new Parcelable.Creator<ServiceBeanX>() {
                @Override
                public ServiceBeanX createFromParcel(Parcel source) {
                    return new ServiceBeanX(source);
                }

                @Override
                public ServiceBeanX[] newArray(int size) {
                    return new ServiceBeanX[size];
                }
            };
        }
    }
}
